package com.lubase.metadata.invoke;

import com.lubase.core.extend.IInvokeMethod;
import com.lubase.metadata.service.ConstraintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;

@Component
public class addConstraintInvoke implements IInvokeMethod {
    @Autowired
    ConstraintService constraintService;

    @Override
    public Object exe(HashMap<String, String> mapParam) throws Exception {
        return constraintService.addConstraint(checkAndGetParam("columnId", mapParam), checkAndGetParam("refColumnId", mapParam));
    }

    @Override
    public String getDescription() {
        return "创建关系：保存关系";
    }

    @Override
    public String getId() {
        return "1481415397524639744";
    }
}
